package org.wordml.core.units;
/**
 * Defines a positive measurement for: twips, half-points<br/>
 * <br/>
 * Namespace  http://schemas.microsoft.com/office/word/2003/wordml <br/>
 * Schema name  XML Document 2003 <br/>
 *  
 * see {@link twipsMeasurePropertys} {@link hpsMeasureProperty}
 * @author juan.c.garciamatos
 */
public final class Units {
	private Units(){}	
	private static final long base = 1440;
	
	/**
	 * Defines a positive measurement in twips (twentieths of a point, 1/1440 of an inch)
	 * @param inch
	 * @return
	 */
	public static long toTwips(int inch){
		return base * inch;
	}
	/**
	 * Defines a positive measurement in half-points (1/144 of an inch).
	 * @param inch
	 * @return (1/144 of an inch)
	 */
	public static long toHalfPoints(int inch){
		return (base/10) * inch;
	}
}
